package com.dsbridge.enrollment.client;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.dsbridge.enrollment.dao.CourseAuthorDAO;
import com.dsbridge.enrollment.model.CourseAuthorDTO;

public class CourseAuthorClient {
	
	public static void main(String[] args) {
		
		ApplicationContext appContext=new ClassPathXmlApplicationContext("applicationContext.xml");
		
		CourseAuthorDAO courseAuthorDAO=appContext.getBean(CourseAuthorDAO.class);
		
		CourseAuthorDTO courseAuthorDTO=new CourseAuthorDTO();
		courseAuthorDTO.setAuthor("Joe");
		courseAuthorDTO.setLoginName("RamaRao");
		courseAuthorDTO.setPassword("R1234");
		courseAuthorDTO.setFirstName("RamaRao");
		courseAuthorDTO.setLastName("N.T");
		courseAuthorDTO.setGender("M");
		courseAuthorDTO.setAddressLine1("144 E Parkway st");
		courseAuthorDTO.setCity("Kansas City");
		courseAuthorDTO.setState("Kansas");
		courseAuthorDTO.setZipcode("63450");
		int i=courseAuthorDAO.create(courseAuthorDTO);
        System.out.println("Returned from CourseAuthorDAO: "+i);
	}

}
